﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 产品表基础输入参数
/// </summary>
public class productsBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 物料编码
    /// </summary>
    [Required(ErrorMessage = "物料编码不能为空")]
    public virtual string? ProductsEncode { get; set; }
    
    /// <summary>
    /// 物料名称
    /// </summary>
    [Required(ErrorMessage = "物料名称不能为空")]
    public virtual string? ProductsName { get; set; }
    
    /// <summary>
    /// 规格
    /// </summary>
    [Required(ErrorMessage = "规格不能为空")]
    public virtual long? SpecificationsId { get; set; }
    
    /// <summary>
    /// 型号
    /// </summary>
    [Required(ErrorMessage = "型号不能为空")]
    public virtual long? ModelId { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    [Required(ErrorMessage = "供应商不能为空")]
    public virtual long? VendorId { get; set; }
    
    /// <summary>
    /// 有效日期
    /// </summary>
    [Required(ErrorMessage = "有效日期不能为空")]
    public virtual string? ExpirationDate { get; set; }
    
    /// <summary>
    /// 计量单位
    /// </summary>
    [Required(ErrorMessage = "计量单位不能为空")]
    public virtual long? MeteringUnitId { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public virtual long? ClassifyId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [Required(ErrorMessage = "是否启用不能为空")]
    public virtual bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品表分页查询输入参数
/// </summary>
public class PageproductsInput : BasePageInput
{
    /// <summary>
    /// 物料编码
    /// </summary>
    public string? ProductsEncode { get; set; }
    
    /// <summary>
    /// 物料名称
    /// </summary>
    public string? ProductsName { get; set; }
    
    /// <summary>
    /// 规格
    /// </summary>
    public long? SpecificationsId { get; set; }
    
    /// <summary>
    /// 型号
    /// </summary>
    public long? ModelId { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 有效日期
    /// </summary>
    public string? ExpirationDate { get; set; }
    
    /// <summary>
    /// 计量单位
    /// </summary>
    public long? MeteringUnitId { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    public long? ClassifyId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    public bool? IsEnable { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 产品表增加输入参数
/// </summary>
public class AddproductsInput
{
    /// <summary>
    /// 物料编码
    /// </summary>
    [Required(ErrorMessage = "物料编码不能为空")]
    [MaxLength(32, ErrorMessage = "物料编码字符长度不能超过32")]
    public string? ProductsEncode { get; set; }
    
    /// <summary>
    /// 物料名称
    /// </summary>
    [Required(ErrorMessage = "物料名称不能为空")]
    [MaxLength(32, ErrorMessage = "物料名称字符长度不能超过32")]
    public string? ProductsName { get; set; }
    
    /// <summary>
    /// 规格
    /// </summary>
    [Required(ErrorMessage = "规格不能为空")]
    public long? SpecificationsId { get; set; }
    
    /// <summary>
    /// 型号
    /// </summary>
    [Required(ErrorMessage = "型号不能为空")]
    public long? ModelId { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    [Required(ErrorMessage = "供应商不能为空")]
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 有效日期
    /// </summary>
    [Required(ErrorMessage = "有效日期不能为空")]
    [MaxLength(32, ErrorMessage = "有效日期字符长度不能超过32")]
    public string? ExpirationDate { get; set; }
    
    /// <summary>
    /// 计量单位
    /// </summary>
    [Required(ErrorMessage = "计量单位不能为空")]
    public long? MeteringUnitId { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public long? ClassifyId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [Required(ErrorMessage = "是否启用不能为空")]
    public bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品表删除输入参数
/// </summary>
public class DeleteproductsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 产品表更新输入参数
/// </summary>
public class UpdateproductsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 物料编码
    /// </summary>    
    [Required(ErrorMessage = "物料编码不能为空")]
    [MaxLength(32, ErrorMessage = "物料编码字符长度不能超过32")]
    public string? ProductsEncode { get; set; }
    
    /// <summary>
    /// 物料名称
    /// </summary>    
    [Required(ErrorMessage = "物料名称不能为空")]
    [MaxLength(32, ErrorMessage = "物料名称字符长度不能超过32")]
    public string? ProductsName { get; set; }
    
    /// <summary>
    /// 规格
    /// </summary>    
    [Required(ErrorMessage = "规格不能为空")]
    public long? SpecificationsId { get; set; }
    
    /// <summary>
    /// 型号
    /// </summary>    
    [Required(ErrorMessage = "型号不能为空")]
    public long? ModelId { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>    
    [Required(ErrorMessage = "供应商不能为空")]
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 有效日期
    /// </summary>    
    [Required(ErrorMessage = "有效日期不能为空")]
    [MaxLength(32, ErrorMessage = "有效日期字符长度不能超过32")]
    public string? ExpirationDate { get; set; }
    
    /// <summary>
    /// 计量单位
    /// </summary>    
    [Required(ErrorMessage = "计量单位不能为空")]
    public long? MeteringUnitId { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>    
    [Required(ErrorMessage = "分类不能为空")]
    public long? ClassifyId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>    
    [Required(ErrorMessage = "是否启用不能为空")]
    public bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品表主键查询输入参数
/// </summary>
public class QueryByIdproductsInput : DeleteproductsInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataproductsInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 产品表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportproductsInput : BaseImportInput
{
    /// <summary>
    /// 物料编码
    /// </summary>
    [ImporterHeader(Name = "*物料编码")]
    [ExporterHeader("*物料编码", Format = "", Width = 25, IsBold = true)]
    public string? ProductsEncode { get; set; }
    
    /// <summary>
    /// 物料名称
    /// </summary>
    [ImporterHeader(Name = "*物料名称")]
    [ExporterHeader("*物料名称", Format = "", Width = 25, IsBold = true)]
    public string? ProductsName { get; set; }
    
    /// <summary>
    /// 规格 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? SpecificationsId { get; set; }
    
    /// <summary>
    /// 规格 文本
    /// </summary>
    [ImporterHeader(Name = "*规格")]
    [ExporterHeader("*规格", Format = "", Width = 25, IsBold = true)]
    public string SpecificationsFkDisplayName { get; set; }
    
    /// <summary>
    /// 型号 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ModelId { get; set; }
    
    /// <summary>
    /// 型号 文本
    /// </summary>
    [ImporterHeader(Name = "*型号")]
    [ExporterHeader("*型号", Format = "", Width = 25, IsBold = true)]
    public string ModelFkDisplayName { get; set; }
    
    /// <summary>
    /// 供应商 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 供应商 文本
    /// </summary>
    [ImporterHeader(Name = "*供应商")]
    [ExporterHeader("*供应商", Format = "", Width = 25, IsBold = true)]
    public string VendorFkDisplayName { get; set; }
    
    /// <summary>
    /// 有效日期
    /// </summary>
    [ImporterHeader(Name = "*有效日期")]
    [ExporterHeader("*有效日期", Format = "", Width = 25, IsBold = true)]
    public string? ExpirationDate { get; set; }
    
    /// <summary>
    /// 计量单位 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? MeteringUnitId { get; set; }
    
    /// <summary>
    /// 计量单位 文本
    /// </summary>
    [ImporterHeader(Name = "*计量单位")]
    [ExporterHeader("*计量单位", Format = "", Width = 25, IsBold = true)]
    public string MeteringUnitFkDisplayName { get; set; }
    
    /// <summary>
    /// 分类 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ClassifyId { get; set; }
    
    /// <summary>
    /// 分类 文本
    /// </summary>
    [ImporterHeader(Name = "*分类")]
    [ExporterHeader("*分类", Format = "", Width = 25, IsBold = true)]
    public string ClassifyFkDisplayName { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [ImporterHeader(Name = "*是否启用")]
    [ExporterHeader("*是否启用", Format = "", Width = 25, IsBold = true)]
    public bool? IsEnable { get; set; }
    
}
